function initPrint(item,url,printer,id,code){
			 $(item).attr("href","#"+url);
			 $(item).attr("data-toggle","modal");
			 packFormDefaultPrinter(printer); 
			 $("#"+id).val(code);
}
function printTableAndBARCODE(code,printName,PageType,page,BARCODETop,BARCODELef,BARCODEWidth,BARCODEHeight,table){
	
	LODOP.PRINT_INIT(code);
	LODOP.ADD_PRINT_BARCODE(BARCODETop+"mm", BARCODELef+"mm", BARCODEWidth+"mm", +BARCODEHeight+"mm", "Code39", code);
	LODOP.SET_PRINT_PAGESIZE(1, 0, 0, PageType) ;
	LODOP.ADD_PRINT_TABLE(40,0, "100%","93%",table);
	if (LODOP.SET_PRINTER_INDEXA(printName)) {
		if (LODOP.SET_PRINT_COPIES(page)) LODOP.PRINT(); 
	}
}
function initLodop() {
	LODOP = getLodop(document.getElementById('LODOP_OB'), document
			.getElementById('LODOP_EM'));
}

function date2str(x, y) {   
	  var z = {      
			  y: x.getFullYear(),      
			  M: x.getMonth() + 1,      
			  d: x.getDate(),      
			  h: x.getHours(),      
			  m: x.getMinutes(),      
			  s: x.getSeconds()   
			  };   
	  return y.replace(/(y+|M+|d+|h+|m+|s+)/g, function(v) {      
		  return ((v.length > 1 ? "0" : "0") + eval('z.' + v.slice(-1))).slice(-(v.length > 2 ? v.length : 2))   
	 });
}